home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 38
/
Amiga Format CD38 (1999-03-15)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-04].iso
/
-seriously_amiga-
/
programming
/
other
/
cyberxxxsrc
/
misc
/
math64.asm
< prev
next >
Wrap
Assembly Source File
|
1999-02-08
|
1KB
|
48 lines
;prog:phxass/gigaphxass txt/Math64.asm to obj/Math64.o noexe
SECTION Math64,CODE
XDEF _add64
; void __asm add64 (register __a0 struct EClockVal *dst,
; register __a1 struct EClockVal *src);
_add64: addq.l #4,a1
addq.l #4,a0
move.l (a1),d0
add.l d0,(a0)
addx.l -(a1),-(a0)
rts
XDEF _sub64
; void __asm sub64 (register __a0 struct EClockVal *dst,
; register __a1 struct EClockVal *src);
_sub64: addq.l #4,a1
addq.l #4,a0
move.l (a1),d0
sub.l d0,(a0) ; dst->lo - src->lo
subx.l -(a1),-(a0) ; dst->hi - src->hi
rts
XDEF _cmp64
; int __asm cmp64 (register __a0 struct EClockVal *dst,
; register __a1 struct EClockVal *src);
_cmp64: cmpm.l (a1)+,(a0)+ ; (a0)-(a1), dst->hi - src->hi
bne.b 1$
cmpm.l (a1)+,(a0)+ ; dst->lo - src->lo
bne.b 1$
moveq #0,d0 ; dst=src
rts
1$: bpl.b 2$
moveq #1,d0 ; dst<src
rts
2$: moveq #-1,d0 ; dst>src
rts
end